// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
require('es6-promise').polyfill();
import Vue from 'vue'
import FastClick from 'fastclick'
import VueRouter from 'vue-router'
import Home from './Home'
import store from '@/store/report/index'
import router from '@/router/report'
FastClick.attach(document.body)

Vue.config.productionTip = false


/*
 * 千分位 过滤器
 * value 进参
 * precision  保留几位小数
 * separator分隔符    分隔符 默认为","
 */
Vue.filter('thousands', function (value, precision, separator) {
    var num = value;
    var parts;
    //判断是否为数字
    if (!isNaN(parseFloat(num)) && isFinite(num)) {
        num = Number(num);
        num = (typeof precision !== 'undefined' ? num.toFixed(precision) : num).toString();
        parts = num.split('.');
        parts[0] = parts[0].toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1' + (separator || ','));
        return parts.join('.');
    }
    return value;
});


/* eslint-disable no-new */
new Vue({
  router,
  store,
  render: h => h(Home)
}).$mount('#app-box')
